<div id="icon-edit" class="icon32 icon32-posts-post"><br></div>
<h2>编辑新闻</h2>
<?php if (isset($validationErrors)): ?>
<div class="error">
<?php
    foreach($validationErrors as $field => $messages) {
        echo $field, " : ", $messages[0], "<br/>";
    }
?>
</div>
<?php endif; ?>
<hr/>
<?php
echo $this->Form->create('Admin.News', array('type' => 'file'));
echo $this->Form->input('Admin.News.id', array('type'=>'hidden'));
echo $this->Form->input('Admin.News.title', array('label'=>'新闻标题'));
echo $this->Form->input('Admin.News.release_date', array('label'=>'新闻发布时间'));
echo $this->Form->input('Admin.News.news_category_id', array('label'=>'所属新闻类别'));
echo $this->Form->input('Admin.News.priority', array('label'=>'优先级', 'type'=>'number'));
echo $this->Form->input('Admin.News.news_icon', array(
    'type' => 'file',
    'label' => '列表缩图',
    'after' => '129x90'
));
if (!empty($this->Form->data['Admin']['News']['news_icon'])) {
    echo $this->Html->image('/'.$this->Form->data['Admin']['News']['news_icon']);
}
echo $this->Form->input('Admin.News.news_detail_url', array('label'=>'案例详情url'));
echo $this->Form->input('Admin.News.news_relation_url', array('label'=>'媒体相关报道'));
?>

    <div class="input text">
        <label for="data[Admin][News][news_memo]">新闻简述</label><br/>
        <?php echo $this->Form->textarea('Admin.News.news_memo', array('rows'=>10,'cols'=>100));?>
    </div>

    <div class="input text">
        <label for="data[Admin][News][news_desc]">新闻内容</label><br/>
        <?php echo $this->Form->textarea('Admin.News.news_desc', array('rows'=>10,'cols'=>100));?>
    </div>
    <?php
    foreach (range(0,9) as $i) {
        echo $this->Form->input("Admin.News.images.$i", array(
            'type' => 'file',
            'label' => '图片'
        ));

        if (isset($this->data['Admin']['News']['images'][$i])
            && !is_array($this->data['Admin']['News']['images'][$i])
        ) {
            $imgUrl = $this->data['Admin']['News']['images'][$i];
            if ($imgUrl) {
                echo $this->Html->image('/'.$imgUrl);
                
            }
        }
    }
    ?>
    <div class="clear"></div>
    <div class="submit">
        <input  type="submit" value="submit"/>
    </div>
</form>

